package com.bbs.web.utils;

import org.apache.commons.lang.StringUtils;

import com.bbs.utils.EncodeUtils;

/**
 * 密码明文加密为密文
 * @author piggsoft
 * @e-mail piggsoft@163.com
 * @since 2013-4-13
 * @version 1.0
 */
public class PasswordUtils {
	public static String encode(String password) {
		if (StringUtils.isEmpty(password)) {
			throw new IllegalArgumentException("password can not be empty");
		}
		return EncodeUtils.sha256Encode(password);
	}
	public static void main(String[] args) {
		System.out.println(encode("admin"));
	}
}
